package com.example.demo.pojo.dto;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Getter
@Setter
@ToString
public class SmsLoginDTO {
    @NotBlank(message = "手机号码不能为空")
    @Pattern(regexp = "^1[0-9]{10}$", message = "手机号码格式错误")
    private String phone;

    @NotBlank(message = "验证码不能为空")
    @Pattern(regexp = "^[0-9]{4}$", message = "验证码为4位纯数字")
    private String code;

    public SmsLoginDTO() {
    }

    public SmsLoginDTO(String phone, String code) {
        this.phone = phone;
        this.code = code;
    }
}